Skip to content

Use Object.defineProperty to extend prototypes#106

Open
majgaard wants to merge 1 commit intoterwanerik:masterfrom
majgaard:master
Open

Use Object.defineProperty to extend prototypes#106
majgaard wants to merge 1 commit intoterwanerik:masterfrom
majgaard:master

Conversation

@majgaard
Copy link

Extending the Array prototype by assignment causes unexpected behavior when iterating via the in operator.

CodePen with example

Instead, Object.defineProperty with enumerable: false should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant